package comWorld.user;

import webManage.UrlTools;

public class UserUrls {
	int id;
	private String home;
	private String admin;
	private String blog;
	private String fellow;
	private String favorites;
	private String fans;
	
	private String adminInbox;
	private String adminMsgs;
	private String adminProfile;
	private String adminChqwd;
	private String adminPortrait;
	private String adminNewBlog;
	private String adminDrafts;
	private String adminEditBlog;
	private String adminBlogCatalogs;
	private String adminBlogComments;
	
	public UserUrls(UserInfo user) {
		id = user.getId();
		
		home = UrlTools.WEBROOTURL + "u/" + id;
		updateOtherUrls();
	}
	
	public UserUrls(int id) {
		this.id = id;
		
		home = UrlTools.WEBROOTURL + "u/" + id;
		updateOtherUrls();
	}
	
	public void setRootPath(String path) {
		home = path + home;
		updateOtherUrls();
	}
	
	private void updateOtherUrls() {
		admin = home + "/admin";
		blog = home + "/blog";
		fellow = home + "/fellow";
		favorites = home + "/favorites";
		fans = home + "/fans";
		
		adminInbox = admin + "/inbox";
		adminMsgs = admin + "/msgs";
		adminProfile = admin + "/profile";
		adminPortrait = admin + "/portrait";
		adminChqwd = admin + "/chqwd";
		adminNewBlog = admin+ "/new-blog";
		adminDrafts = admin + "/drafts";
		adminEditBlog = admin + "/edit-blog";
		adminBlogCatalogs = admin + "/blog-catalogs";
		adminBlogComments = admin + "/blog-comments";
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getHome() {
		return home;
	}

	public void setHome(String home) {
		this.home = home;
	}

	public String getFans() {
		return fans;
	}

	public void setFans(String fans) {
		this.fans = fans;
	}

	public String getAdmin() {
		return admin;
	}

	public void setAdmin(String admin) {
		this.admin = admin;
	}

	public String getAdminInbox() {
		return adminInbox;
	}

	public void setAdminInbox(String adminInbox) {
		this.adminInbox = adminInbox;
	}
	
	public String getAdminMsgs() {
		return adminMsgs;
	}

	public void setAdminMsgs(String adminMsgs) {
		this.adminMsgs = adminMsgs;
	}

	public String getAdminProfile() {
		return adminProfile;
	}

	public void setAdminProfile(String adminProfile) {
		this.adminProfile = adminProfile;
	}

	public String getAdminChqwd() {
		return adminChqwd;
	}

	public void setAdminChqwd(String adminChqwd) {
		this.adminChqwd = adminChqwd;
	}

	public String getAdminPortrait() {
		return adminPortrait;
	}

	public void setAdminPortrait(String adminPortrait) {
		this.adminPortrait = adminPortrait;
	}

	public String getBlog() {
		return blog;
	}

	public void setBlog(String blog) {
		this.blog = blog;
	}

	public String getFellow() {
		return fellow;
	}

	public void setFellow(String fellow) {
		this.fellow = fellow;
	}

	public String getFavorites() {
		return favorites;
	}

	public void setFavorites(String favorites) {
		this.favorites = favorites;
	}

	public String getAdminNewBlog() {
		return adminNewBlog;
	}

	public void setAdminNewBlog(String adminNewBlog) {
		this.adminNewBlog = adminNewBlog;
	}

	public String getAdminDrafts() {
		return adminDrafts;
	}

	public void setAdminDrafts(String adminDrafts) {
		this.adminDrafts = adminDrafts;
	}

	public String getAdminBlogCatalogs() {
		return adminBlogCatalogs;
	}

	public void setAdminBlogCatalogs(String adminBlogCatalogs) {
		this.adminBlogCatalogs = adminBlogCatalogs;
	}

	public String getAdminBlogComments() {
		return adminBlogComments;
	}

	public void setAdminBlogComments(String adminBlogComments) {
		this.adminBlogComments = adminBlogComments;
	}

	public String getAdminEditBlog() {
		return adminEditBlog;
	}

	public void setAdminEditBlog(String adminEditBlog) {
		this.adminEditBlog = adminEditBlog;
	}
	
}
